package com.group.mall.mapper;

import com.group.mall.domain.POJO.GoodsPro;
import com.group.mall.domain.POJO.ShoppingCart;
import com.group.mall.domain.VO.ShoppingCartVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {

    /**
     * 查看购物车
     * @return
     */
    @Select("select * from hmall.shoppingcart where user_id=#{userId}")
    List<ShoppingCart> list(Integer userId);
    /**
     * 根据id删除商品
     * @param id
     */
    @Delete("delete from hmall.shoppingcart where id = #{id}")
    void deleteById(Long id);


    @Select("select * from hmall.goods_pro where id=#{goodsId}")
    List<GoodsPro> goodsprolist(Integer goodsId);

    void add(Long id);

    void sub(Long id);
    /*
    更新选择商品种类信息
     */
    void updatecart(ShoppingCartVO shoppingCartVO);
}